<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>选项卡插件</title>
    <link href="http://www.imooc.com/data/jquery-ui.css" rel="stylesheet" type="text/css" />
    <link href="style.css" rel="stylesheet" type="text/css" />
    <script src="http://www.imooc.com/data/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="http://www.imooc.com/data/jquery-ui-1.9.2.min.js" type="text/javascript"></script>
</head>

<body>
<div id="divtest">
    <div id="tabs">
        <ul>
            <li><a href="#tabs-1">最爱吃的水果</a></li>
            <li><a href="#tabs-2">最喜欢的运动</a></li>
        </ul>
        <div id="tabs-1">
            <p>橘子</p>
            <p>香蕉</p>
            <p>葡萄</p>
            <p>苹果</p>
            <p>西瓜</p>
        </div>
        <div id="tabs-2">
            <p>足球</p>
            <p>散步</p>
            <p>篮球</p>
            <p>乒乓球</p>
            <p>骑自行车</p>
        </div>
    </div>
</div>

<script type="text/javascript">
    $(function () {
        $("#tabs").tabs ({
            //设置各选项卡在切换时的动画效果
            fx: { opacity: "toggle", height: "toggle" },
            event: "mousemove" //通过移动鼠标事件切换选项卡
        })
    });
</script>
</body>
</html>